package com.whj.ems.service.impl;

import java.util.List;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.whj.ems.dao.CompanyDao;
import com.whj.ems.entity.Company;
import com.whj.ems.service.CompanyService;
@Service
public class CompanyServiceImpl extends BaseServiceImpl<Company> implements
		CompanyService {
	
	@Resource(name="companyDao")
	private CompanyDao companyDao;
	
	@PostConstruct
	public void setCompanyDao() {
		super.setBaseDao(companyDao);
	}
	@Override
	public List<Company> get() throws Exception {
		return super.get();
	}
	@Override 
	public void save(Company entity) throws Exception {
		super.save(entity);
	}
	public void updateById(Company company) throws Exception {
		super.update(company);
	}
	@Override
	public void deleteById(int gid) throws Exception {
		Company company=this.companyDao.load(gid);
		super.delete(company);
	}
	@Override
	public void deleteByIds(List<Company> companies)throws Exception {
		super.deleteByIds(companies);
	}
	@Override
	public List<Company> getByfenye(int start,int number,String searchType,String urlPamer) throws Exception {
		return this.companyDao.getByfenye(start, number,searchType,urlPamer);
	}
	@Override
	public int getCountCompany(Class<Company> class1) throws Exception {
		return super.getCount(class1);
	}
}
